package vip.ifmm.lehouse.common.enums.status;

import vip.ifmm.lehouse.common.enums.Statable;

/**
 * 商品服务响应状态枚举类
 *
 * @author Fish
 * <p>Email: fishinlove@163.com</p>
 * <p>created by 2019/06/21 20:17:44</p>
 */
public enum CommodityStatus implements Statable {

    SUCCESS(Statable.SUCCESS_CODE, "商品保存成功！"),
    COMMODITY_TYPE_SAVED(Statable.SUCCESS_CODE, "商品分类信息保存成功！"),
    COMMODITY_TYPE_UPDATED(Statable.SUCCESS_CODE, "商品分类信息更新成功！"),
    COMMODITY_TYPE_DELETED(Statable.SUCCESS_CODE, "商品分类信息删除成功！"),
    COMMODITY_UPDATED(Statable.SUCCESS_CODE, "商品信息更新成功！"),
    COMMODITY_INFO_IS_UNCOMPLETED(100, "商品信息不完整！"),
    COMMODITY_SAVED_FAILED(200, "商品保存失败！"),
    COMMODITY_TYPE_IS_MISSING(300, "商品分类信息缺失！"),
    COMMODITY_TYPE_SAVED_FAILED(400, "商品分类信息保存失败！"),
    COMMODITY_TYPE_UPDATED_FAILED(500, "商品分类信息更新失败！"),
    COMMODITY_TYPE_DELETED_FAILED(600, "商品分类信息删除失败！"),
    COMMODITY_NOT_FOUND(700, "找不到这个商品！"),
    COMMODITY_UPDATED_FAILED(800, "商品信息更新失败！");

    private int code = Statable.SUCCESS_CODE;
    private String msg = Statable.SUCCESS_MSG;

    CommodityStatus(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
